import React, {createElement} from 'react';
import {View} from 'react-native-ui-lib';
import {useRoute} from '@react-navigation/native';
import allComs from './allComs';

function FormPage(props) {
  const route = useRoute();
  const {title, type} = route.params;
  return (
    <View>{createElement(allComs[type], {...props, ...route.params})}</View>
  );
}

export default FormPage;
